﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Douban.Core;
using Douban.Api.Broadcast;

namespace Douban.Modules.Broadcast.ViewModels
{
    public class CommentItemViewModel : ObservableObject
    {
        private Comment _internalComment;

        public CommentItemViewModel(Comment comment)
        {
            _internalComment = comment;
            Name = comment.User.Name;
            Comment = comment.Content;
            PublishedTime = comment.PublishedTime;
        }
        
        private string _name;

        public string Name
        {
            get { return _name; }
            set
            {
                if (_name != value)
                {
                    _name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }
        
        private string _comment;

        public string Comment
        {
            get { return _comment; }
            set
            {
                if (_comment != value)
                {
                    _comment = value;
                    NotifyPropertyChanged("Comment");
                }
            }
        }
        
        private DateTime _publishedTime;

        public DateTime PublishedTime
        {
            get { return _publishedTime; }
            set
            {
                if (_publishedTime != value)
                {
                    _publishedTime = value;
                    NotifyPropertyChanged("PublishedTime");
                }
            }
        }	
							
    }
}
